<script language="javascript">
function kt()
{
if(document.getElementById("SO_category_checked").checked==true)
{

	document.getElementById("SO_category_images").type="file";
}
else
{
	document.getElementById("SO_category_images").type="text";
}

}
</script>
<?
session_start();
$JO[ "Unit"				] = JO( array( "EN" => "Unit",				"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Đơn Vị"		) );
$JO[ "Content"			] = JO( array( "EN" => "Content",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nội Dung"		) );
$JO[ "Subject"			] = JO( array( "EN" => "Subject",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Tựa Đề"		) );
$JO[ "channel"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "Kênh"		) );
$JO[ "broadcast"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "Thơi Gian Phát Sóng"		) );
$JO[ "rebroadcast"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "Thơi Gian Phát Sóng Lai"		) );
$JO[ "Image"			] = JO( array( "EN" => "Image",				"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Hình Ảnh"		) );
$JO[ "Insert"			] = JO( array( "EN" => "Insert",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhập"		) );
$JO[ "InsertIndex"		] = JO( array( "EN" => "Insert a Index",	"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhập Index"		) );
$JO[ "InsertShowList"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "nhập ShowCategory"		) );
$JO[ "delete"			] = JO( array( "EN" => "Delete",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Xóa"		) );
$JO[ "InsertContent"	] = JO( array( "EN" => "Insert a Content",	"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Nhập Công Việc"		) );
$JO[ "IndexList"		] = JO( array( "EN" => "Index List", 		"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Danh Sách Index"		) );
$JO[ "ShowList"          ] =   JO( array( "EN" => "Index List", 		"KO" =>  "dasdsa"     , "VI" => "Danh Sách ShowCategory"		) );
$JO[ "Key"				] = JO( array( "EN" => "Key", 				"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Mã Số"		) );
$JO[ "Operator"			] = JO( array( "EN" => "Operator",			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Người Điều Hành"		) );
$JO[ "Link"				] = JO( array( "EN" => "Link", 				"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Đường Dẫn"		) );
$JO[ "Update"			] = JO( array( "EN" => "Update", 			"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Cập Nhật"		) );
$JO[ "UpdateIndex"		] = JO( array( "EN" => "Update a Index", 	"KO" => "ì•„í‹°ìŠ¤íŠ¸",	"VI" => "Cập Nhật Index"		) );
$JO[ "UpdateShowList"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "Update ShowCategory"		) );
$JO[ "UpdateShow"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "cập nhật"		) );
$JO[ "insertShow"          ] =   JO( array( "EN" => "Show List", 		"KO" =>  "dasdsa"     , "VI" => "nhập"		) );


?>
<div class="JO_left">



	<?

		if( $_REQUEST[ "SO_show_category" ] ) {

			$query = "
				SELECT	*
				FROM	`show_category`
				WHERE	`key` = '" . $_REQUEST[ "SO_show_category" ] . "'
			";

			$recordSet = JO_query( $query );

			if( $recordSet -> num_rows ) $record = $recordSet -> fetch_array( );

		}

	?>



	<!-- Form -->

		<form
			action	= "JO_71_SO/SO_05_execution.php"
			target	= "JO_integration_asynchronous"
			method	= "post"
			class	= "JO_bar_720"
            enctype="multipart/form-data"
		>

			
			
			<input type="hidden" name="SO_query"		value="<?= empty( $_REQUEST[ 'SO_show_category' ] ) ? 'category_insert' : 'category_update' ?>"/>
			<input type="hidden" name="SO_category_key"	value="<?= $_REQUEST[ "SO_show_category" ] ?>"										/>

			<h1><?= empty( $_REQUEST[ "SO_show_category" ] ) ? $JO[ "InsertShowList" ] : $JO[ "UpdateShowList" ] ?></h1>

			<div>

				

					<!--1-->

					<!--2-->
				<table>
					<tr>
						<th style="padding-top: 12px; vertical-align: top;">subject</th>
						<td>

							<textarea
								name	= "SO_category_subject"
								style	= "width: 567px; height: <?= substr_count( $record[ "subject" ], "\r\n" ) ? substr_count( $record[ "content" ], "\r\n" ) * 16 : 16 ?>px;"
								onkeyup	= "this.style.height = ( this.value.split( '\n' ).length * 16 ) + 'px'";
							><?= $record[ "subject" ] ?></textarea>

						</td>
					</tr>

					<tr>
						<th >channel</th>
						<td>

							<input
								type	= "text"
								name	= "SO_category_channel"
								value	= "<?= $record[ "channel" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
							 />

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "Image"	]?></th>
						<td >
                        

							<input
								type	= "text"
								name	= "SO_category_images"
								value	= "<?= $record[ "image" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
                                id="SO_category_images"
							 />
                           <tr>
                           <th>
                           cách thêm ảnh
                           </th>
                           <td>
							<input
                            	type="checkbox"
                                name="SO_category_checked"
                                style="vertical-align:middle"
                                id="SO_category_checked"
                              	onchange="kt();"
                                value="1"
                                
                              />  chọn ảnh
                            </td>
						</tr>
                        </td>
                        
                    
					</tr>
					
                   
					<tr>
						<th><?=$JO[ "broadcast"	]?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_category_broadcast"
								value	= "<?= $record[ "broadcast" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
							 />

						</td>
					</tr>
						<th><?=$JO[ "rebroadcast"	]?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_category_rebroadcast"
								value	= "<?= $record[ "rebroadcast" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
							 />

						</td>
					</tr>
					<tr>
						<th><?=$JO[ "Insert"	]?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_category_insert"
								value	= "<?= $record[ "insert" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
							 />

						</td>
					</tr>

					<tr>
						<th><?=$JO[ "delete"	]?></th>
						<td>

							<input
								type	= "text"
								name	= "SO_category_delete"
								value	= "<?= $record[ "delete" ] ?>"
								style	= "width: <?= $JO_MSIE ? 569 : 571 ?>px;"
							 />

						</td>
					</tr>

					<tr>
						<th style	= "border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF;"></th>
						<td style	= "border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF;">

							<input
								type	= "submit"
								value	= "<?= empty( $_REQUEST[ "SO_show_category" ] ) ? $JO[ "InsertShowList"	] : $JO[ "UpdateShowList"		] ?>"
								class	= "JO_button"
								style	= "width: 584px;"
							/>

						</td>
					</tr>

				</table>

			</div>



		</form>



	<!-- List -->

		<div class="JO_bar_720">

			<h1><?=$JO[ "ShowList"	]?></h1>

			<div>


				<form action="JO_71_SO/SO_05_execution.php" method="post" >
				<table style="margin: 2px 3px 1px -3px;">

					<tr>
						<th style="width: 49px;"><?=$JO[ "Key"	]?>		</th>
						<th style="width: 65px;"><?=$JO[ "Subject"	]?>		</th>
						<th						><?=$JO[ "channel"	]?>	</th>
                        <th						><?=$JO[ "Image"	]?>	</th>
                        <th						><?=$JO[ "broadcast"	]?>	</th>
                        <th						><?=$JO[ "rebroadcast"	]?>	</th>
						<th style="width: 89px;"><?=$JO["insertShow" ]?>	</th>
						<th>Delete</th>
					</tr>
					
					<?

						$query = "
							SELECT		*
							FROM		`show_category`
							WHERE		`delete` IS NULL
							ORDER BY	`key` DESC
						";

						$recordSet = JO_query( $query );

						if( $recordSet -> num_rows ) while( $record = $recordSet -> fetch_array( ) ) {
					
					?>
					
						<tr>

							<td class="JO_right"><?= $record[ "key" ] ?></td>
                            
                            <td><a href="?SO_unit=14_show_category&SO_show_category=<?= $record[ "key" ] ?>"><?= $record[ "subject"	] ?></a></td>
                                                 
                            <td><?= $record[ "channel" ] ?></td>
                             
                            <td><?=$record[ "image" ] ?></td>
                            
							<td><?= $record[ "broadcast" ] ?></td>
                            
                            <td><?= $record[ "rebroadcast" ] ?></td>

							<td><?= substr( $record[ "insert" ], 0, 16 ) ?></td>
                           
                            <td> <input type="checkbox" name="chb[]" value="<?= $record["key"]?>"/></td>

						</tr>
					
					<? } ?>
                   
				</table>
                	<input type="hidden" name="SO_query"		value="category_delete"/>
 					<input type="submit" value="xoa" style="margin-bottom:0px !important; height:30px;text-align:right"/>
					</form>
				

			</div>

		</div>



</div>
